
import { themes } from './model'
// 修改页面中的样式变量值
const changeStyle = (obj:any) => {
    for(const key in obj) {
        document.getElementsByTagName('body')[0].style.setProperty(`--${key}`, obj[key])
    }
}

// 改变主题的方法
export const setTheme = async(themeName: any) => {
    const themeConfig = themes[themeName]
    changeStyle(themeConfig)
}